<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>院系信息管理</title>
    <link rel="stylesheet" href="./login.css">
    <script>
        function login() {
            window.location = "department.php";
        }
    </script>
</head>
<body>
    <div class="loginCard">
            <h1 >
                <style>
                    h1{
                        text-align: center;
                    }
                </style>
                院系信息
            </h1>
            <?php
                 header("Content-type:text/html;charset=utf-8");
                 $con = mysqli_connect("localhost", 'root', '', 'ksdb2');
                 mysqli_set_charset($con, "utf8");

                 $dpt_id = $_GET['dpt_id'];
                 $sql="select * from department where department.dpt_id = '$dpt_id';";
                 $result = mysqli_query($con,$sql);
                 echo "<table border='1'><tr><th>院系号</th>
                 <th>院系名</th>
                 
                 </tr>";
                 $row = mysqli_fetch_array($result);
                    echo "<tr>";
                    echo "<td>" . $row['dpt_id'] . "</td>";
                    echo "<td>" . $row['dpt_name'] . "</td>";

                    echo "<tr>";
                 
                 echo "</table>";
 
	             mysqli_close($con);
            ?>
            
            <br>
            
            <div>
                
                <button type="button" onclick="login()">返回</button>
                
            </div>
            
            